%{

#include "xrnlib.h"

%}

%include cpointer.i
%include carrays.i
%include cmalloc.i
%include stdint.i

FILE *fopen(char *, char *);
int fseek(FILE *, long int, int );
long int ftell(FILE *);
void rewind( FILE * );
int fclose(FILE *);
unsigned fread(void *ptr, unsigned size, unsigned nobj, FILE *);
unsigned fwrite(void *ptr, unsigned size, unsigned nobj, FILE *);
void *malloc(int nbytes);
void free(void *);

%pointer_functions(int, intp);
%pointer_functions(float, floatp);
%pointer_functions( xrn_lib_xtype_t , xrn_lib_xtype_tp );
%pointer_functions( uint64_t , uint64p );
%pointer_functions( uint32_t , uint32p );

%array_functions(uint8_t, uint8p )
%array_functions(FILE *, FILEp_array);
%array_functions(uint8_t *, uint8p_array )
%array_functions(uint64_t , uint64p_array )

%pointer_cast( char , uint8_t , char_to_uint8 )

typedef long time_t;
time_t time(time_t *t);

%include "xrnlib.h"
